#ifndef DATIMPOSTAZIONIPROGETTO_H
#define DATIMPOSTAZIONIPROGETTO_H

#include "abstractdat.h"
#include "filebased.h"
#include "savingstate.h"

#include "Work.h"
#include "Comm.h"
#include "projectdata.h"

class DatImpostazioniProgetto:
        virtual public AbstractDat,
        virtual public FileBased,
        virtual public SavingState
{
public:
    DatImpostazioniProgetto();
    ~DatImpostazioniProgetto();

    bool get ( Work*& p_work ) const;
    bool get ( Comm*& p_comm ) const;

    Work* getWork (void) const;
    Comm* getComm (void) const;

    ProjectData getProjectData (void) const;

    string getWorkId (void) const;
      void setWorkId (const string& workId) const;

    // Overridding for [FileBased]
    virtual ExaFileErr fileSave (const string& file_name = "project.prj") const;
    virtual ExaFileErr fileOpen (const string& file_name = "project.prj");
    virtual ExaFileObj  fileObj (void) const;

    // Overridding for [SavingState]
    virtual void    save (void);
    virtual void restore (void);

    // overridding of [AbstractDat]
    virtual ExaModuleObj getModuleDat ( void ) const;

protected:
    // overridding of [AbstractDat]
    virtual bool   installDat ( void );
    virtual bool  uninstallDat ( void );

private:
    Work* m_work;
    Comm* m_comm;

    Work m_work_cache;
    Comm m_comm_cache;

    static        int m_jet_created; // for [AbstractDat]
    static ExaFileObj m_file_obj;    // for [FileBased]
};

#endif // DATIMPOSTAZIONIPROGETTO_H
